<?php

/**
 * InstruccionComplentaria form base class.
 *
 * @method InstruccionComplentaria getObject() Returns the current form's model object
 *
 * @package    sysdoc-v.1
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseInstruccionComplentariaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_instruccion_complementaria' => new sfWidgetFormInputHidden(),
      'id_hoja_de_ruta'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('DetalleRuta'), 'add_empty' => false)),
      'instruccion_complementaria'    => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'id_instruccion_complementaria' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_instruccion_complementaria')), 'empty_value' => $this->getObject()->get('id_instruccion_complementaria'), 'required' => false)),
      'id_hoja_de_ruta'               => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('DetalleRuta'))),
      'instruccion_complementaria'    => new sfValidatorString(),
    ));

    $this->widgetSchema->setNameFormat('instruccion_complentaria[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'InstruccionComplentaria';
  }

}
